package com.wefans.wefansapp.common.tool.popup;

import android.content.Context;
import android.view.View;
import android.widget.Button;

import com.wefans.wefansapp.R;

public class MemberJoinDialog extends BaseDialog {

	private Button mBtnClose = null;
	private Button mBtnConfirm = null;
	
	private OnConfirmListener mConfirmListener = null;
	
	public interface OnConfirmListener {
		void onJoinComplete();
	}
	
	public MemberJoinDialog(Context mContext, OnConfirmListener confirmListener) {
		super(mContext);
		
		setContentView(R.layout.dialog_member_join);
		
		mBtnClose = (Button)findViewById(R.id.BTN_DIALOG_CLOSE);
		mBtnConfirm = (Button)findViewById(R.id.BTN_JOIN_CONFIRM);
		
		mConfirmListener = confirmListener;
		mBtnClose.setOnClickListener(onClickListener);
		mBtnConfirm.setOnClickListener(onClickListener);
	}

	android.view.View.OnClickListener onClickListener = new android.view.View.OnClickListener() {
		
		public void onClick(View v) {
			
			switch (v.getId()) {
			case R.id.BTN_JOIN_CONFIRM:
				if (mConfirmListener != null) {
					mConfirmListener.onJoinComplete();
				}
				dismiss();
				break;
			case R.id.BTN_DIALOG_CLOSE:
				dismiss();
				break;
			}
		}
	};

}
